The Design Notes API > The Design Notes C API > BOOL GetNotesKeys() |
![]() ![]() ![]() |
Description
Gets a list of all the keys in a Design Notes file.
Arguments
FileHandle
noteHandle
, char*
keyBufArray[64]
, int
keyArrayMaxLen
![]() |
The first argument is the file handle returned by OpenNotesFile() . |
![]() |
The second argument is the buffer array where the keys should be stored. |
![]() |
The third argument is the integer returned by GetNotesKeyCount( noteHandle ) , indicating the maximum number of items in the key buffer array. |
Returns
A Boolean value indicating whether the operation was successful; stores the key names in keyBufArray
.
Example
The following code prints the key names and values of all the keys in the Design Notes file associated with welcome.html:
typedef char[64] InfoKey; FileHandle noteHandle = OpenNotesFile("file:///c|sites/avocado8/¬ iwjs/welcome.html"); if (noteHandle > 0){ int keyCount = GetNotesKeyCount(noteHandle); if (keyCount <= 0) return; InfoKey* keys = new InfoKey[keyCount]; BOOL succeeded = GetNotesKeys(noteHandle, keys, keyCount); if (succeeded){ for (int i=0; i < keyCount; i++){ printf("Key is: %s\n", keys[i]); printf("Value is: %s\n\n", GetNote(noteHandle, keys[i]); } delete keys; } CloseNotesFile(noteHandle);
![]() ![]() ![]() |